/***************************************************************************
 *   Copyright (C) 2007 by Warren Kenny   				   *
 *   warren.kenny@gmail.com   						   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef GSADDRESS_H
#define GSADDRESS_H

#include <gsCore/gsCore.h>

class gsAddress
{
public:
	
	gsAddress();
	
	/**
	 * 	Constructor, creates a gsAddress object with the specified parameters
	 * @param address The IP address of the host, in network-byte-order format
	 * @param port The Port of the remote host, in network-byte-order format
	 */
	gsAddress( const gsUInt32 address, const gsUInt16 port );
	
	/**
	 * 	Copy constructor
	 * @param other Other gsAddress object
	 */
	gsAddress( const gsAddress& other );
	
	/**
	 * 	Assigns the address represented by another gsAddress object to this object
	 * @param other A reference to the other gsAddress object
	 * @return A refernence to this object
	 */
	gsAddress& operator=( const gsAddress& other );
	
	/**
	 * 	Gets the port associated with this object
	 * @return The port associated with this object
	 */
	const gsUInt16 getPort();
	
	/**
	 * 	Gets the IP address associated with this object
	 * @return The IP address
	 */
	const gsUInt32 getAddress();
	
	/**
	 * 	Sets the port for this object
	 * @param port The new port
	 */
	void setPort( const gsUInt16 port );
	
	/**
	 * 	Sets the IP address for this object
	 * @param address The new IP address
	 */
	void setAddress( const gsUInt32 address );
	
	~gsAddress();

private:
	
	gsUInt16 m_port;
	
	gsUInt32 m_address;
	
};

#endif
